<template>
  <div>
    <van-row v-for="(button, index) in list" :key="index">
      <van-col :span="item.span" v-for="(item, index) in button" :key="index">
        <qt-button :color="item.color" @click="click(item.event)">
          {{ item.name }}
        </qt-button>
      </van-col>
    </van-row>
  </div>
</template>

<script>
import qtButton from '../button';

export default {
  name: 'qt-button-group',

  components: {
    qtButton,
  },

  props: {
    list: {
      type: Array,
      default() {
        return [];
      },
    },
  },

  methods: {
    click(event) {
      this.$emit('click', event);
    },
  },
};
</script>
